function Foo(name) {
    this.name = name
}

Foo.prototype.myName = function () {
    return this.name
}

function Bar(name, label) {
    Foo.call(this, name)
    this.label = label
}

//这里是关键
Bar.prototype = Object.create(Foo.prototype)

Bar.prototype.myLabel = function () {
    return this.label
}

var a = new Bar("a", "Obj a")

a.myName() //"a"
a.myLabel() //"Obj a"

Object.setPrototypeOf(Bar.prototype, Foo.prototype)